package com.demo2.springioc.bean;


import com.demo2.springioc.model.UserInfo;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class BeanDemo {
    @Bean
    public String getStr1() {
        return "str1";
    }

    @Bean
    public String getStr2() {
        return "str2";
    }







}


@Configuration
class  BeanDemo1{
    @Bean
    public UserInfo userInfo1() {
        return new UserInfo(19,"帅哥~");
    }

        @Bean
    public UserInfo userInfo2() {
        return  new UserInfo(88,"奶奶");
    }

}


